<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Article Management</title>
<?php $this->view('regions/head'); ?>
</head>
<body>
<div id="wrapper" class="block">
	<?php $this->view('regions/header'); ?>
	<div id="content" class="block">
		<!-- START FORM -->
			<?php echo form_open_multipart('admin/cms/article/save'); ?>
	        <?php echo fx_control::newInstance('formKey')->createType('hidden')->setData('value', random_string('unique', 16))->render(); ?>
			<?php echo fx_control::newInstance('id')->createType('hidden')->binding($model, 'id')->render(); ?>
		<div class="formContainer stdWidth autoCenter autoHeight">
			<!-- HEADER FORM -->
			<div class="formHeader">
				<table class="fullWidth">
					<tr>
						<td class="column50">
							<h3 class="moduleHeader">
								<?php if (!$model->isLoaded()) :?>
									Edit New Article
								<?php else :?>
									Edit Article <?php echo $model->getName(); ?>
								<?php endif; ?>
							</h3>
						</td>
						<td class="column50 rightAlign">
							<button type="button" onclick="window.location='<?php echo site_url("admin/cms/article/index", true)?>'">
								<span>Back</span>
							</button>
							<button type="submit">
								<span>Save</span>
							</button>
							<?php if ($model->isLoaded()) :?>
							<button type="button" onclick="window.location='<?php echo site_url("admin/cms/article/delete/", true)?>'">
								<span>Delete</span>
							</button>
							<?php endif; ?>
							<button type="reset" onclick="window.location='<?php echo site_url("admin/cms/article/edit", true)?>'">
								<span>Reset</span>
							</button>
						</td>
					</tr>
				</table>
			</div>
			<!-- TAB SECTION -->
			<div id="tabArticle" class="tabContainer">
				<ul>
                	<li><a href="<?php echo site_url("admin/cms/article/generalTab", true); ?>"><span>General Data</span></a></li>
                	<li><a href="<?php echo site_url("admin/cms/article/publishTab", true); ?>"><span>Publish</span></a></li>
                    <li><a href="<?php echo site_url("admin/cms/article/metaTab", true); ?>"><span>Meta Data</span></a></li>                    
                </ul>
			</div>
		</div>
		<?php echo form_close(); ?>
	</div>
	<?php $this->view('regions/footer'); ?>
	<!-- Init Tabs -->
	<script type="text/javascript">
		jQuery('#tabArticle').tabs({
			remote: true
		});		
	</script>
</div>
</body>
</html>
